<template>
    <div class="app-container">




        <data-table ref="tableId" url="/TopicRecord/List" :column="dataColum" :where="{ UserId: userId }">
            <template v-slot:header>
                <!-- <el-button type="primary" plain icon="el-icon-edit" @click="ShowEditModal()">新 增</el-button> -->
                <h3>话 题 浏 览 记 录</h3>
            </template>
            <template v-slot:operate="scope">

                <el-button type="text" @click="Look(scope.row.TopicId)">查 看</el-button>
            </template>
        </data-table>
    </div>
</template>

<script>
import store from '@/store';
import { mapGetters } from 'vuex'
export default {
    name: "TopicRecordList",
    computed: {
        ...mapGetters([
            'name', 'roleTypeFormat', 'avatar', 'userId', 'loginTimePeriod', "user", 'userId', 'roleType'
        ])
    },
    data() {

        return {
            lock: 0,//用来防止重复提交的变量
            searchForm: {},//搜索定义的数据对象
            dataColum: [
                {
                    key: "Id",
                    hidden: true,

                },
                {
                    key: "TopicTypeId",
                    hidden: true,
                },
                {
                    key: "TopicTypeDto.Name",
                    title: "话题类型",
                    type: store.getters.columnType.SHORTTEXT,
                },
                {
                    key: "TopicId",
                    hidden: true,
                },
                {
                    key: "TopicDto.Title",
                    title: "话题",
                    type: store.getters.columnType.SHORTTEXT,
                },


                {
                    key: "CreationTime",
                    title: "浏览时间",
                    type: store.getters.columnType.SHORTTEXT,
                },
                {
                    width: "300px",
                    title: "操作",
                    type: store.getters.columnType.USERDEFINED,
                },

            ],
            editModalFormRules: {
                "TopicTypeId": [
                ],

                "TopicId": [
                ],

                "UserId": [
                ],

            },
            formData: {

            },//保存或者修改定义的数据对象
            editorShow: false,//编辑弹窗定义的数据对象

        };
    },
    created() {

    },
    methods: {
        async Look(Id) {
            this.$router.push({
                path: `/Client/TopicDetail`, query: {
                    TopicId: Id,
                }
            });
        },


    },
};
</script>
